package com.aaa.qy127.controller;

import com.aaa.qy127.dao.TongJiDao;
import com.aaa.qy127.dao.impl.TongJiDaoImpl;
import com.aaa.qy127.service.TongJiService;
import com.aaa.qy127.service.impl.TongJiServiceImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/tongji")
public class TongJiController {
    TongJiService tongJiService = new TongJiServiceImpl();

    /**
     * 查询库存书籍类型和数量
     * @return
     */
    @RequestMapping("/type")
    public List<Map<String,Object>> gettype(){
        List<Map<String, Object>> gettype = tongJiService.gettype();
        return gettype;
    }

    /**
     * 查询库存书籍名称和数量
     * @return
     */
    @RequestMapping("/book")
    public List<Map<String,Object>> getbook(){
        List<Map<String, Object>> getbook = tongJiService.getbook();
        return getbook;
    }
    /**
     * 查询出库书籍名称和数量
     * @return
     */
    @RequestMapping("/ckbook")
    public List<Map<String,Object>> getckbook(){
        List<Map<String, Object>> getckbook = tongJiService.getckbook();
        return getckbook;
    }
    /**
     * 查询出库书籍类型和数量
     * @return
     */
    @RequestMapping("/cktype")
    public List<Map<String,Object>> getcktype(){
        List<Map<String, Object>> getcktype = tongJiService.getcktype();
        return getcktype;
    }
    /**
     * 查询入库金额按月分组
     * @return
     */
    @RequestMapping("/ruku")
    public List<Map<String, Object>> getruku(String time){
        List<Map<String, Object>> getruku = tongJiService.getruku(time);
        return getruku;
    }
    /**
     * 查询出库金额按月分组
     * @return
     */
    @RequestMapping("/chuku")
    public List<Map<String,Object>> getchuuku(String time){
        List<Map<String, Object>> getchuuku = tongJiService.getchuuku(time);
        return getchuuku;
    }
    /**
     * 查询出库金额按月分组
     * @return
     */
    @RequestMapping("/dd")
    public List<Map<String,Object>> getdd(String time){
        List<Map<String, Object>> getdd = tongJiService.getdd(time);
        return getdd;
    }
}
